// vite.config.ts
import { defineConfig, loadEnv } from "file:///D:/01Flies/%E5%89%8D%E7%AB%AF%E5%AD%A6%E4%B9%A0/vue3_admin_template/project/node_modules/.pnpm/vite@5.0.4_@types+node@18.18.13_sass@1.69.5_terser@5.24.0/node_modules/vite/dist/node/index.js";
import vue from "file:///D:/01Flies/%E5%89%8D%E7%AB%AF%E5%AD%A6%E4%B9%A0/vue3_admin_template/project/node_modules/.pnpm/@vitejs+plugin-vue@4.5.0_vite@5.0.4_@types+node@18.18.13_sass@1.69.5_terser@5.24.0__vue@3.3.9_typescript@5.3.2_/node_modules/@vitejs/plugin-vue/dist/index.mjs";
import { viteMockServe } from "file:///D:/01Flies/%E5%89%8D%E7%AB%AF%E5%AD%A6%E4%B9%A0/vue3_admin_template/project/node_modules/.pnpm/vite-plugin-mock@2.9.6_mockjs@1.1.0_rollup@4.6.0_vite@5.0.4_@types+node@18.18.13_sass@1.69.5_terser@5.24.0_/node_modules/vite-plugin-mock/dist/index.js";
import { createSvgIconsPlugin } from "file:///D:/01Flies/%E5%89%8D%E7%AB%AF%E5%AD%A6%E4%B9%A0/vue3_admin_template/project/node_modules/.pnpm/vite-plugin-svg-icons@2.0.1_vite@5.0.4_@types+node@18.18.13_sass@1.69.5_terser@5.24.0_/node_modules/vite-plugin-svg-icons/dist/index.mjs";
import path from "path";
var vite_config_default = defineConfig(({ command, mode }) => {
  let env = loadEnv(mode, process.cwd());
  return {
    plugins: [
      vue(),
      createSvgIconsPlugin({
        iconDirs: [path.resolve(process.cwd(), "src/assets/icons")],
        symbolId: "icon-[dir]-[name]"
      }),
      viteMockServe({
        localEnabled: command === "serve"
        //保证开发阶段使用mock接口
      })
    ],
    resolve: {
      alias: {
        "@": path.resolve("./src")
        // 相对路径别名配置，使用 @ 代替 src
      }
    },
    //scss全局变量的配置
    css: {
      preprocessorOptions: {
        scss: {
          javascriptEnabled: true,
          additionalData: '@import "./src/styles/variable.scss";'
        }
      }
    },
    assetsInclude: ["**/*.hdr"],
    // 添加对 HDR 文件的支持
    build: {
      // 配置输出目录结构
      assetsDir: "assets",
      rollupOptions: {
        output: {
          // JS 文件输出到 js 目录
          chunkFileNames: "js/[name]-[hash].js",
          entryFileNames: "js/[name]-[hash].js",
          // CSS 文件输出到 css 目录
          assetFileNames: (assetInfo) => {
            if (assetInfo.name.endsWith(".css")) {
              return "css/[name]-[hash][extname]";
            }
            return "assets/[name]-[hash][extname]";
          },
          // 手动分割包配置
          manualChunks(id) {
            if (id.includes("node_modules")) {
              return "vendor";
            }
          }
        }
      }
    },
    //代理跨域
    server: {
      proxy: {
        [env.VITE_APP_BASE_API]: {
          // target: 'http://jsonplaceholder.typicode.com',
          //获取数据服务器地址设置
          target: env.VITE_SERVE,
          //需要代理跨域
          changeOrigin: true,
          //路径重写
          rewrite: (path2) => path2.replace(/^\/api/, "")
        }
      }
    }
  };
});
export {
  vite_config_default as default
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCJEOlxcXFwwMUZsaWVzXFxcXFx1NTI0RFx1N0FFRlx1NUI2Nlx1NEU2MFxcXFx2dWUzX2FkbWluX3RlbXBsYXRlXFxcXHByb2plY3RcIjtjb25zdCBfX3ZpdGVfaW5qZWN0ZWRfb3JpZ2luYWxfZmlsZW5hbWUgPSBcIkQ6XFxcXDAxRmxpZXNcXFxcXHU1MjREXHU3QUVGXHU1QjY2XHU0RTYwXFxcXHZ1ZTNfYWRtaW5fdGVtcGxhdGVcXFxccHJvamVjdFxcXFx2aXRlLmNvbmZpZy50c1wiO2NvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9pbXBvcnRfbWV0YV91cmwgPSBcImZpbGU6Ly8vRDovMDFGbGllcy8lRTUlODklOEQlRTclQUIlQUYlRTUlQUQlQ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